﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Test1
{
    public partial class Form1 : Form
    {
        public string Names { get; set; }
        public string Password { get; set; }

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)  //登录
        {

            var uid = textBox1.Text;
            var pwd = textBox2.Text;

            if(uid ==Name && pwd == Password)
            {
                MessageBox.Show("登录成功！");
                MainForm mainForm = new MainForm();
                this.Hide();
                mainForm.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show("登录失败！");
            }
        }

        private void button2_Click(object sender, EventArgs e)  //注册
        {
            RegisterForm registerForm = new RegisterForm();
            registerForm.Show();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Names = "王大锤";
            Password = "2048";
        }
    }
}
